<script setup>
import { reactive, toRefs } from 'vue';

  const student = reactive({
    name: 'tom',
    age: 18
  })

  // 将一个对象交给 toRefs 处理的话, 里面的每个属性解构出来, 保持响应式
  const {name, age} = toRefs(student)

</script>

<template>
  <div>
    {{ name }} 今年已经 {{ age }} 岁了
  </div>
  <button @click="age++">过一年</button>
</template>

<style lang="scss" scoped></style>
